pub fn new_birthday_probability(n: u32) -> f64 {
    if n < 2 {
        return 0.0; // If less than 2 people, no chance of a shared birthday
    }

    let mut probability_all_different = 1.0; // Start with 100% probability
    let total_days = 365;

    for i in 0..n {
        probability_all_different *= (total_days - i) as f64 / total_days as f64;
    }

    // Probability of at least two people sharing a birthday
    1.0 - probability_all_different
}
